package xy.come.juhenews.Base;

import android.app.Activity;

import java.util.ArrayList;
import java.util.List;

/**
 * 副基类
 * Created by Xia_焱 on 2018/7/8.
 * e-mail：XiahaotianV@163.com
 */
public class ActivityCollector {
    public static List<Activity> activities = new ArrayList<>();

    public static void addActivity(Activity activity) {
        activities.add(activity);
    }

    public static void removeActivity(Activity activity) {
        activities.remove(activity);
    }

    public static void finshAll() {
        for (Activity activity : activities) {
            //判断当前activity 是否被干掉！
            if (!activity.isFinishing()) {
                activity.finish();
            }
        }
    }
}
